import request from '@/utils/request'

// 查询成列切图任务列表
export function listArithCutTask(query) {
  return request({
    url: '/cut/arith-cut-task/list',
    method: 'get',
    params: query
  })
}

// 查询成列切图任务详细-图片
export function getArithCutTaskDetails(id) {
  return request({
    url: '/cut/arith-cut-task/get-details/' + id,
    method: 'get'
  })
}

// 查询成列切图任务详细
export function getArithCutTask(id) {
  return request({
    url: '/cut/arith-cut-task/' + id,
    method: 'get'
  })
}

//导入图片
export function uploadImage(data) {
  return request({
    url: '/cut/arith-cut-task/cut-image',
    method: 'post',
    data: data,
    timeout: 60 * 10 * 1000,
  })
}


// 新增成列切图任务
export function addArithCutTask(data) { 
  return request({
    url: '/cut/arith-cut-task/cut-image',
    method: 'post',
    data: data,
    //params:data,
  })
}

// 修改成列切图任务
export function updateArithCutTask(data) {
  return request({
    url: '/arithmetic/arith-cut-task',
    method: 'put',
    data: data
  })
}

// 删除成列切图任务
export function delArithCutTask(id) {
  return request({
    url: '/cut/arith-cut-task/' + id,
    method: 'delete'
  })
}

// 逻辑删除成列切图任务
export function removedArithCutTask(id) {
  return request({
    url: '/arithmetic/arith-cut-task/' + id,
    method: 'delete'
  })
}

// 下载
export function downloadMinImgZip(data) {
  return request({
    url: '/arithmetic/arith-cut-task/download-zip',
    method: 'post',
    responseType: 'blob',
    headers:{
      "Content-Type": "application/x-www-form-urlencoded", //请求头要加这个
    },
    data
  })
}

// 开始切图
export function handleCutImage(data) {
  return request({
    url: '/cut/arith-cut-task/handler-cut-image/?requestId='+data,
    method: 'get',
  })
}


